﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections;
using System.Collections.Generic;
using System.IO;

/// <summary>
/// Liệt kê tất cả danh sách các theme có sẵn trong thư mục App_Code
/// </summary>
public class ThemeManager
{
	public ThemeManager()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public static List<Theme> GetThemes()
    {
        DirectoryInfo dInfo = new DirectoryInfo(System.Web.HttpContext.Current.Server.MapPath("~/App_Themes"));
        DirectoryInfo[] dArrInfo = dInfo.GetDirectories();
        List<Theme> list = new List<Theme>();

        foreach (DirectoryInfo d in dArrInfo)
        {
            Theme temp = new Theme(d.Name);
            list.Add(temp);
        }

        return list;
    }

}
